Kenexa     Kenexa XML Integrations                                                     

 

 

 

 Source Code to post the XML to the Kenexa Web Service in C#

 

Parameters

URL = Kenexa provided Web Service URL

Input XML = XML being submitted

 

//Attach the Web service as a Web Reference and attach the interface by the "using" keyword in the class file

using KenexaXMLIntegrations.KRBMSGDispatch;

 

    private string CallWebServiceIntegrations(string WebServiceURL, string InputXML)

        {

            string strXML = "";

            sSuccessCode = "405"; sShortDescription = ""; sLongDescription = "";

 

            try

            {

                KRBMSGDispatch.DispatchMessage integrationsURL = new DispatchMessage();

 

                integrationsURL.Url = WebServiceURL;

                strXML = integrationsURL.Dispatch(InputXML);

 

                integrationsURL.Abort();

 

                XmlDocument xmlDoc = new XmlDocument();

                xmlDoc.LoadXml(strXML);

                string Success = xmlDoc.SelectSingleNode("//Code").InnerText;

 

                sShortDescription = xmlDoc.SelectSingleNode("//PacketInfo/Status/ShortDescription").InnerText;

                sLongDescription = xmlDoc.SelectSingleNode("//PacketInfo/Status/LongDescription").InnerText;

 

                if (Success == "200")

                {

                    sSuccessCode = "200";

                }

            }

            catch (Exception ex)

            {

                sShortDescription = ex.Source;

                sLongDescription = ex.ToString();

            }

            return strXML;

        }

 

 

© 2008 Kenexa